<!DOCTYPE HTML>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <title>window对象</title>
    <script>
    function p(s) {
        document.write("<p class='content'>" + s + "</p>");
    }
    </script>
    <style type="text/css" media="screen">
    body {
        width: 960px;
        margin: 0 auto;
        font: 18px/1.8em '微软雅黑';
    }

    h1 {
        color: green;
    }

    h2 {
        border-bottom: 2px solid green;
        line-height: 1.8em;
    }

    p {
        font-size: 20;
        padding: 5px 0;
        font-weight: bolder;
    }
    p.content {
        font-weight: normal;
        padding-left: 2em;
        line-height: 1.5em;
        margin: 0;
    }
    </style>
</head>

<body onload="autoscroll();">
    <h1>window对象</h1>
    <p>window对象属性枚举</p>
    <script>
    for(var i = 0 in window) {
        p(i + '=' + window[i] );
    }
    p(innerHeight);
    // close();
    // window.scrollTo( 0, 1000 ); //注意不同浏览器的运行结果

    function delayedscroll() {
        window.setTimeout(s(), 4000);
    }
    function s() {
        window.scrollByPages(1);
    }
    // open("http://www.baidu.com/",
"Baidu_WindowName",
 "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
    // delayedscroll();
    // // function autoscroll() {
    //     window.setInterval(s,4000);
    // }
    </script>

</body>

</html>
